<template>
	<view class="container">
		<view class="list">
			<view class="list-item" v-for="(item, index) in list" :key="index" @click="toBill(item)">
				<view class="list-item__content">
					<view class="">{{ item.buildingName }} {{ item.name }}</view>
				</view>
				<view class="list-item__arrow-right">
					<!-- <view class="list-item__tip">是否逾期</view> -->
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { roomList } from '@/api/room';
	export default {
		data() {
			return {
				list: []
			}
		},
		methods: {
			getRoomList() {
				roomList().then(res => {
					this.list = res.data;
				});
			},
			toBill(item) {
				uni.navigateTo({
					url: `/pages/billing/index?roomId=${item.roomId}`,
				})
			}
		},
		onLoad() {
			this.getRoomList();
		}
	}
</script>

<style lang="scss" scoped>
.list {
	padding: 8px;
	.list-item {
		position: relative;
		width: 100%;
		padding: 32rpx 32rpx 32rpx 20rpx;
		background-color: #FFF;
		border-radius: 10rpx;
		margin-bottom: 20rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
	}
	.list-item__content {
		line-height: 1.4em;
	}
	.list-item__arrow-right {
		position: absolute;
		right: 32rpx;
		top: 50%;
		transform: translateY(-50%);
		display: flex;
		align-items: center;
	}
}
</style>